package test;

import java.util.Scanner;

/**
 * @author chihb
 * @create-time 2024/6/19 22:38
 * @description
 */
public class Score {
    public static void main(String[] args) {
        System.out.println(getScore(5));
    }

    private static int getScore(int n){
        Scanner s=new Scanner(System.in);
        int[] array=new int[n];
        int num;
        for (int i = 0; i < n; i++) {
            num=s.nextInt();
            if(num>0&&num<101){
                array[i]=num;
            }
        }
        int max=array[0];
        int min=array[0];
        for (int i = 0; i < n; i++) {
            if(max<array[i]){
                max=array[i];
            }
            if(min>array[i]){
                min=array[i];
            }
        }
        int sum=0;
        for (int i:array){
            sum+=i;
        }
        int avg=(sum-max-min)/(n-2);
        return avg;
    }
}
